#ifndef PLAY_H
#define PLAY_H

#include <QMainWindow>

#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkRequest>
#include <QDebug>
#include <QMessageBox>

#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>

#include <QTimer>
#include "game.h"
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class Play : public QMainWindow
{
    Q_OBJECT
    Game game;
    Game* g;
public:
    explicit Play(QWidget *parent = nullptr);
       void Delay_MSec(unsigned int msec);
       void paintEvent(QPaintEvent *event);
       void keyPressEvent(QKeyEvent *event);
signals:
public slots:
    void M();
    void B();
    void B2();
private:
    Ui::MainWindow *ui;
    QString userID;
    QNetworkAccessManager * manager;
    QNetworkRequest request;
private slots:
    //按下按键，提交自己的坐标到服务器
    void send();
    // 定时执行的update函数，用于拉取服务器端所有的操作记录
    void receive();

};

#endif // PLAY_H
